package de.herberlin.webapp.user;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;

import de.herberlin.webapp.core.Functions;

public class AdminTag extends BodyTagSupport {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	
	private boolean admin=true;

	@Override
	public int doStartTag() throws JspException {
		
		boolean yes=admin == Functions.isAdmin((HttpServletRequest)pageContext.getRequest());
		
		if (yes){
			return EVAL_BODY_INCLUDE;
		} else {
			return SKIP_BODY;
		}
	}

	public void setAdmin(boolean admin) {
		this.admin = admin;
	}

	
	
}
